#ifndef _ROOM_BASE_HPP
#define _ROOM_BASE_HPP
#include <cstdint>
#include <memory>
#include <vector>
class Player;
enum class ROOM_TYPE : unsigned char
{
    ROOM_TYPE_UNKNOW,
    ROOM_TYPE_PVP3,
    ROOM_TYPE_PVP2,
};

enum class ROOM_STATUS : unsigned char
{
    ROOM_STATUS_UNKNOW,
    ROOM_STATUS_CREATE,
    ROOM_STATUS_INIT,
    ROOM_STATUS_IDLE,
    ROOM_STATUS_WAIT,
    ROOM_STATUS_RUN,
    ROOM_STATUS_END,
};

class RoomBase
{
public:
    RoomBase(uint64_t roomUid, ROOM_TYPE type = ROOM_TYPE::ROOM_TYPE_UNKNOW, ROOM_STATUS status = ROOM_STATUS::ROOM_STATUS_UNKNOW) : _roomUid(roomUid){}
    virtual ~RoomBase() {}
public:
    // evnet api
    virtual int OnEventPlayerEnter(std::shared_ptr<Player> player) { return 0;}
    virtual int OnEventPlayerLeave(std::shared_ptr<Player> player) { return 0;}
    virtual int OnEventPlayerOk(std::shared_ptr<Player> player) { return 0;}
    // ...
private:
    ROOM_TYPE _type;
    ROOM_STATUS _status;
    uint64_t _roomUid;
    std::vector<std::shared_ptr<Player>> _players;
};

class RoomPVP3 : public RoomBase
{
public:
    RoomPVP3(uint64_t roomUid) : RoomBase(roomUid, ROOM_TYPE::ROOM_TYPE_PVP3, ROOM_STATUS::ROOM_STATUS_CREATE){}
};

class RoomPVP2 : public RoomBase
{
public:
    RoomPVP2(uint64_t roomUid) : RoomBase(roomUid, ROOM_TYPE::ROOM_TYPE_PVP2, ROOM_STATUS::ROOM_STATUS_CREATE){}
};
#endif